package sctu.edu.java.year2016.team01.chenhong.day20160521.chapter4_2;

/**
 * Created by Administrator on 2016/5/21.
 * 打印菱形
 */
import java.util.Scanner;
public class Rhombus{
    public static void main(String[] args){


        Scanner scan=new Scanner(System.in);
        System.out.println("请输入菱形边长：");
        int a=scan.nextInt();



        int i;int j;int m;
        for (i= 1; i <= a; i++) {
            for (j = a; j >= i; j--) {

                System.out.print(" ");
            }
            System.out.print("*");
            for (m = 1; m <= (i - 1) * 2; m++) {
                System.out.print(" ");
            }
            if (i != 1) {
                System.out.print("*");
            }
            System.out.println();

        }







        for (i = a; i >= 1; i--) {
            for (j = a; j >= i; j--) {
                System.out.print(" ");
            }
            System.out.print("*");
            for (m = 1; m <= (i - 1) * 2; m++) {
                System.out.print(" ");
            }
            if (i != 1) {
                System.out.print("*");
            }
            System.out.println();
        }
    }
}